<template>
    <van-popup
            v-model="iframe_show"
            closeable
            position="bottom"
            @close="iframe_close"
            
            :style="{ height: '100%' }"
    >
        <iframe :src="src" frameborder="0" width="100%" height="100%"></iframe>
    </van-popup>
</template>

<script>
    import { Popup } from 'vant';
    export default {
        name: "iframe_alt",
        props: ['show','type','src'],
        data() {
            return {
                iframe_show: this.show
            }
        },
        watch: {
            show(val){
                this.iframe_show = val
                if(val && this.type == 2){
                    window.location.href = this.src
                }
            }
        },
        components: {
            [Popup .name]: Popup
        },
        methods: {
            iframe_close() {
                this.$emit('close')
            }
        },
        mounted() {
            console.log(this.type)
        }
    }
</script>

<style>
    .van-popup__close-icon{
        color: rgb(0,0,0,0);
		background: url(../assets/images/reset.png);
		background-size: 100%;
		width: 40px;
		height: 40px;
    }
</style>
